package com.example.demo.service;

import com.example.demo.entity.UserEntity;
import com.example.demo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2023-05-06
 * Time: 17:05
 */
@Service // 访问数据库
public class UserService {
    @Autowired
    private UserMapper userMapper;
    // mybatis 可以直接是用接口

    // 注入类 允许外部是用该类访问这个方法查询数据库
    public List<UserEntity> getAll() {
        return userMapper.getAll();
    }
}
